package com.one.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.one.bean.CollectFootpoint;
import com.one.vo.CollectFootpointVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName: CollectFootpoint
 * @Auther: yph
 * @Date: 2022/1/19 13:50
 * @Description: 用户足迹和收藏持久层接口
 */
@Mapper
public interface CollectFootpointMapper extends BaseMapper<CollectFootpoint> {

    /**
     * @Author: yph
     * @Date: 2022/1/19 14:45
     * @return:
     * @Description: 查询用户最近一个月内的足迹
     */
    List<CollectFootpointVo> queryFootpointByUserId(@Param("userId") Integer userId,
                                                    @Param("pageNo") Integer pageNo,
                                                    @Param("pageSize") Integer pageSize);

    /**
     * @Author: yph
     * @Date: 2022/1/19 14:45
     * @return:
     * @Description: 查询用户最近一个月内的足迹 数量
     */
    Long queryFootpointCountByUserId(@Param("userId") Integer userId);

    /**
     * @Author: yph
     * @Date: 2022/1/19 16:07
     * @return:
     * @Description: 根据用户id 和商品id查询用户收藏记录
     */
    CollectFootpoint queryBuUserIdAndProductId(@Param("userId") Object userId, @Param("productId") Object productId);

    /**
     * @Author: yph
     * @Date: 2022/1/19 18:27
     * @return:
     * @Description: 查询用户所有收藏信息
     */
    List<CollectFootpointVo> queryCollectByUserId(@Param("userId") Integer userId);

    /**
     * @Author: yph
     * @Date: 2022/1/21 21:12
     * @return: 
     * @Description:  查询商品名称，映射到CollectFootpointVo对象中
    */
    List<CollectFootpointVo> queryProductNameByProductId(@Param("productIds") List<Integer> productIds);

    /**
     * @Author: yph
     * @Date: 2022/1/21 22:37
     * @return: 
     * @Description: 根据用户id清空用户所有的收藏信息
    */
    int clearUserCollect(Integer userId);

    /**
     * @Author: yph
     * @Date: 2022/1/22 00:17
     * @return: 
     * @Description: 清空用户足迹
    */
    int clearUserFootPoint(Integer userId);
}
